<template>
   <div>
    <div class="box">
        <h1>PostInfo组件</h1>
        <hr>
        <input type="button" @click="PostInfo" value="发起Post请求" style="color:white;background-color:green">

    </div>
  </div>
</template>

<script>
export default {
name:'PostInfo',
methods:{
   async PostInfo(){
      const {data:res}= await this.$http.post('/api/post',{name:'zs',age:0})
      console.log(res);
    }
}
}
</script>
<style scoped>


.box{
    border: 1px solid black;
    height: 300px;
    width: 300px;
    margin-top: 2px;
}
</style>